load = true

deb = false
rpm = false
pac = false

s = true
f = false
d = false

st = 0

function love.load()
	mainf = love.graphics.newFont("fonts/main.ttf", 50)
	osf = love.graphics.newFont("fonts/main.ttf", 20)
	antergos = love.graphics.newImage( "images/antergos.png" )
	arch = love.graphics.newImage( "images/arch.png" )
	bodhi = love.graphics.newImage( "images/bodhi.png" )
	cent = love.graphics.newImage( "images/cent.png" )
	debian = love.graphics.newImage( "images/debian.png" )
	deepin = love.graphics.newImage( "images/deepin.png" )
	elementary = love.graphics.newImage( "images/elementary.png" )
	fedora = love.graphics.newImage( "images/fedora.png" )
	manjaro = love.graphics.newImage( "images/manjaro.png" )
	mint = love.graphics.newImage( "images/mint.png" )
	redhat = love.graphics.newImage( "images/redhat.png" )
	ubuntu = love.graphics.newImage( "images/ubuntu.png" )
end

function love.draw()
	if load then
		love.graphics.setFont(mainf)
		love.graphics.setColor(0,0,0,255)
		love.graphics.print("Select Your Operating System", 170, 10)
		love.graphics.setBackgroundColor(255,255,255)


		love.graphics.setColor(255,255,255,255)
		love.graphics.draw(antergos, 150, 120,0,0.17)
		love.graphics.draw(arch, 350, 120,0,0.17)
		love.graphics.draw(bodhi, 550, 120,0,0.46)
		love.graphics.draw(cent, 750, 120,0,0.78)
		love.graphics.draw(debian, 150, 260,0,1)
		love.graphics.draw(deepin, 350, 260,0,0.53)
		love.graphics.draw(elementary, 550, 260,0,0.5)
		love.graphics.draw(fedora, 750, 260,0,0.36)
		love.graphics.draw(manjaro, 150, 400,0,0.41)
		love.graphics.draw(mint, 350, 400,0,0.5)
		love.graphics.draw(redhat, 550, 400,0,0.78)
		love.graphics.draw(ubuntu, 750, 400,0,0.16)
	end
	if deb or rpm or pac then
		load = false
		love.graphics.setFont(mainf)
		love.graphics.setColor(0,0,0,255)
		love.graphics.setBackgroundColor(255,255,255,255)
		if s then
			love.graphics.print("Fixing Problems...",300,200)
			st = st + 1
			if st > 100 then
				s = false
				f = true
			end
		end
		if f then
			if deb then
				os.execute("gksudo apt-get update")
			end
			if rpm then
				os.execute("gksudo yum update")
			end
			if pac then
				os.execute("gksudo pacman -Syyu")
			end
				f = false
				d = true
		end
		if d then
			love.graphics.print("All Problems Fixed!",300,200)
			love.graphics.setColor(100,255,0,255)
			love.graphics.rectangle("fill",400,300,200,50)
			love.graphics.setColor(0,0,0,255)
			love.graphics.print("Exit",460,300)
		end
	end
end
function love.mousereleased()
		if love.mouse.getX()>400 and love.mouse.getX()<600 and love.mouse.getY()>300 and love.mouse.getY()<350 then
			love.event.quit()
		end
		if love.mouse.getX()>150 and love.mouse.getX()<250 and love.mouse.getY()>120 and love.mouse.getY()<220 then
			pac = true
		end
		if love.mouse.getX()>350 and love.mouse.getX()<450 and love.mouse.getY()>120 and love.mouse.getY()<220 then
			pac = true
		end
		if love.mouse.getX()>550 and love.mouse.getX()<650 and love.mouse.getY()>120 and love.mouse.getY()<220 then
			deb = true
		end
		if love.mouse.getX()>750 and love.mouse.getX()<850 and love.mouse.getY()>120 and love.mouse.getY()<220 then
			rpm = true
		end
		if love.mouse.getX()>150 and love.mouse.getX()<250 and love.mouse.getY()>260 and love.mouse.getY()<360 then
			deb = true
		end
		if love.mouse.getX()>350 and love.mouse.getX()<450 and love.mouse.getY()>260 and love.mouse.getY()<360 then
			deb = true
		end
		if love.mouse.getX()>550 and love.mouse.getX()<650 and love.mouse.getY()>260 and love.mouse.getY()<360 then
			deb = true
		end
		if love.mouse.getX()>750 and love.mouse.getX()<850 and love.mouse.getY()>260 and love.mouse.getY()<360 then
			rpm = true
		end
		if love.mouse.getX()>150 and love.mouse.getX()<250 and love.mouse.getY()>400 and love.mouse.getY()<500 then
			pac = true
		end
		if love.mouse.getX()>350 and love.mouse.getX()<450 and love.mouse.getY()>400 and love.mouse.getY()<500 then
			deb = true
		end
		if love.mouse.getX()>550 and love.mouse.getX()<650 and love.mouse.getY()>400 and love.mouse.getY()<500 then
			rpm = true
		end
		if love.mouse.getX()>750 and love.mouse.getX()<850 and love.mouse.getY()>400 and love.mouse.getY()<500 then
			deb = true
		end
end